package tech.aistar.controller;

import org.springframework.web.HttpRequestHandler;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/5/8 10:48 上午
 */
public class HelloRequestController implements HttpRequestHandler {
    @Override
    public void handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
        httpServletRequest.setAttribute("username","tom");
        //转发
        httpServletRequest.getRequestDispatcher("/WEB-INF/hello/hello.jsp").forward(httpServletRequest,httpServletResponse);
    }
}
